<?php
session_start();
include('config.inc.php');
// session variable
$sess_id=$_SESSION['sess_id'];
$sess_user=$_SESSION['sess_user'];
$sess_status=$_SESSION['sess_status'];
if ($sess_id<>session_id() || $sess_user=="" || $sess_status<>"active") {
		$_SESSION['cur_page'] = "index.php";
		header( "Location: login.php");exit();
	}
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$charset\" />";
include('runid.php');

	$no = $_POST[no];
	$day_process = $Current_date;
	$solution = $_POST['solution'];
	$username_process = $_POST['username_process'];
	$cost = $_POST['cost'];
	$status=5;
	$complete_status=5;
	/*echo "no ".$no;
	echo "<br>solution ".$solution;
	echo "<br>cost ".$cost;
	*/
	$sql = "update detail set solution='$solution', day_process='$day_process', username_process='$username_process', cost='$cost', status='$status' ,day_complete='$day_process',complete='$complete_status' where no='$no'";
	$result = mysql_query($sql);
	//echo $sql;
	echo "<center><font color='red'>";
	if($result){
		echo "บันทึกการแก้ไขในระบบแล้ว";
	}else{
		echo "ไม่สามารถบันทึกในระบบได้";
	}
	echo "<br><input type='button' name='Button' value='ปิดหน้าต่างนี้' onClick='javascript:window.close()' class='butsubmit'>";
	echo "</font></center>";
?>